/*
 * @lc app=leetcode.cn id=1859 lang=typescript
 *
 * [1859] 将句子排序
 */

// @lc code=start
function sortSentence(s: string): string {
    const list = s.split(" ");
    const temp: string[] = [];
    list.forEach((i) => {
        temp[parseInt(i[i.length - 1]) - 1] = i.slice(0, i.length - 1);
    });
    return temp.join(" ");
}
// @lc code=end
